package com.kevinxiaoge.ruoli.web;

import com.kevinxiaoge.ruoli.bean.User;
import com.kevinxiaoge.ruoli.service.impl.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author chengyuanyuan
 */
@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/addUser")
    public String register(@RequestBody User user) {
        int register = userService.register(user);
        if (register == 1) {
            return "login";
        }
        return "";
    }

    @GetMapping("/bigdata")
    public String bigData(){
        return "bigdata";
    }
}
